1. Field of the Invention
The present invention relates to a magnetic sensor for detecting an angle that the direction of an external magnetic field forms with respect to a reference direction.
2. Description of the Related Art
In recent years, magnetic sensors have been widely used to detect the rotational position of a target object in various applications such as detecting the rotational position of an automotive steering wheel. Linear encoders for detecting a linear displacement of a target object also use magnetic sensors. Systems using such a magnetic sensor are typically provided with means (for example, a magnet) for generating an external magnetic field that rotates in direction in conjunction with the rotation or linear movement of the target object. The magnetic sensor detects the angle that the direction of the external magnetic field forms with respect to a reference direction. The rotational position or linear displacement of the target object is thus detected.
There have been known magnetic sensors that have two bridge circuits (Wheatstone bridge circuits) as shown in U.S. Pat. No. 6,943,544, U.S. Pat. No. 6,633,462, and U.S. Patent Application Publication No. 2009/0206827 A1. In such magnetic sensors, the two bridge circuits each include four magnetoresistive elements (hereinafter, referred to as MR elements). Each bridge circuit detects the intensity of a component of the external magnetic field in one direction, and outputs a signal that indicates the intensity. The output signals of the two bridge circuits differ in phase by ¼ the period of the output signals of the respective bridge circuits. The angle that the direction of the external magnetic field forms with respect to a reference direction is calculated based on the output signals of the two bridge circuits.
When the magnetic sensor using MR elements lies in an external magnetic field that rotates in direction, the waveforms of the output signals corresponding to the resistances of the MR elements ideally trace sinusoidal curves (including both sine and cosine waveforms). As described in U.S. Pat. No. 6,633,462, however, it is known that the output signal waveforms of the MR elements are sometimes distorted from the sinusoidal curves. The distortion of the output signal waveforms of the MR elements can cause an error in the angle detected by the magnetic sensor. The major causes for the distortion of the output signal waveforms of the MR elements are broadly classified into one ascribable to the MR elements and one ascribable to the external magnetic field.
Now, examples of the situation where the output signal waveforms of the MR elements are distorted due to the MR elements will be described for cases where the MR elements are giant magnetoresistive (GMR) elements or tunneling magnetoresistive (TMR) elements. GMR elements and TMR elements each have a magnetization pinned layer whose direction of magnetization is pinned, a free layer whose direction of magnetization varies with the direction of the external magnetic field, and a nonmagnetic layer disposed between the magnetization pinned layer and the free layer. One of the examples where the output signal waveforms of the MR elements are distorted due to the MR elements is when the direction of magnetization of the magnetization pinned layer varies due to the influence of the external magnetic field or the like. Such a situation is likely to occur when the external magnetic field has a relatively high intensity. Another example where the output signal waveforms of the MR elements are distorted due to the MR elements is when the direction of magnetization of the free layer does not coincide with the direction of the external magnetic field due to such factors as the shape anisotropy and coercivity of the free layer. Such a situation is likely to occur when the external magnetic field has a relatively low intensity.
On the other hand, one of the examples where the output signal waveforms of the MR elements are distorted from a sinusoidal curve due to the external magnetic field is when the direction of the external magnetic field or the intensity of a component of the external magnetic field in one direction makes no sinusoidal change. Such a situation is likely to occur when detecting the direction of the external magnetic field occurring from the outer periphery of a rotating body that has one or more pairs of N and S poles arranged alternately in an annular configuration, or when detecting the direction of the external magnetic field occurring from the outer periphery of a moving body that has a plurality of pairs of N and S poles arranged alternately in a linear configuration and moves in the direction of arrangement of the N and S poles.
U.S. Pat. No. 6,633,462 discloses a magnetoresistive sensor in which a main detection element having a main reference magnetization axis is electrically connected with two corrective detection elements each having a reference magnetization axis oblique to the main reference magnetization axis, so that the detection angle is corrected. The sensor, however, requires that the corrective detection elements be optimized in design according to various design conditions including the resistances, size, and materials of the main detection element and the corrective detection elements as well as the intensity of the external magnetic field. This causes the problem of difficulty in designing the sensor.
The description so far has been given of the problem that a magnetic sensor that uses MR elements can cause an error in the angle detected by the magnetic sensor. Nevertheless, such a problem applies to all magnetic sensors that detect the angle the direction of an external magnetic field forms with respect to a reference direction.